//
// Created by 11510 on 2024/6/20.
//
#include <iostream>

using namespace std;

class A {
public:
    void func() { cout << "A::func()" << endl; }

    virtual void run() { cout << "A::run()" << endl; }

    virtual void run1() { cout << "A::run1()" << endl; }

    virtual void run2() { cout << "A::run2()" << endl; }

private:
    double a = 10;
};


class B : /*virtual*/ public A {
public:
    virtual void run() override { cout << "B::run()" << endl; };

    virtual void run1() override { cout << "B::run1()" << endl; };

    virtual void run3() { cout << "B::run1()" << endl; };
private:
    double b = 1;
};

class C : /*virtual*/ public A {
public:
//    void run(){ cout << "B::run()" << endl; };
//
//    void run1(){ cout << "B::run1()" << endl; };

    virtual void run3() { cout << "B::run1()" << endl; };
private:
    double c = 1;
};

class D:public B, public C{
public:
    virtual void run() override{
        cout << "D::run()" << endl;
    }

    virtual void run4(){
        cout << "D::run4()" << endl;
    }
private:
    double d;
};

int main(void) {
    D d;
    B b;
    C c;
    d.run();
    d.run4();

//    A* a1 = &d;
//    A* a2 = &b;
//    A* a3 = &c;

//    cout << sizeof(D) << endl;
    return 0;
}